import { canUseDom } from './can-use-dom'

export function isPromise(obj: unknown): obj is Promise<unknown> {
  return !!obj && typeof obj === 'object' && typeof (obj as any).then === 'function'
}

export function isIOS(): boolean {
  return canUseDom ? /ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase()) : false
}
